package pku.edu.cn.context.service;
/*
 * Copyright 2013, pku Chen Ray.
 * 
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 * 
 *        http://www.apache.org/licenses/LICENSE-2.0
 * 
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

import java.util.HashMap;

import org.alljoyn.bus.annotation.Position;
import org.alljoyn.bus.annotation.Signature;

/*
 * Contact is a data container that describes an entry in the address book for a single contact.
 */
public class Context {
    /*
     * Contact id
     * The Position annotation indicates the numeric position of a field within an 
     * AllJoyn struct (Java class). This value defines the order that fields are 
     * marshalled and unmarshalled.
     * 
     * Each element in the class must have a unique position index. The Position 
     * count starts with a zero index and is incremented by one for each element.
     */
    @Position(0)
    @Signature("i")
    public int id;

    /*
     * The type of the context
     */
    @Position(1)
    @Signature("s")
    public String type;

    @Position(2)
    @Signature("r")
    public Data data;
    
    @Position(3)
    @Signature("s")
    public String time;

    /*
     * buy default assume at least one phone number and one email.
     */
    public Context() {
    	data = new Data();
    }
    
    /*
     * Simple container to hold information about a single phone number.
     * 
     * When specifying an AllJoyn struct (Java class) inside another class
     * it must be declared as a static class with out any methods.  
     */
    public static class Data {
        @Position(0)
        public String name;
        @Position(1)
        public String content;
        @Position(2)
        public String detail;
    }
}